package cn.cdeden.aiqa.domain.vo;

import lombok.Data;

import java.util.List;

/**
 * Dify知识库
 */
@Data
public class DifyKnowledgeBaseCreateVo {
    private String id;
    private String name;
    private String description;
    private String provider;
    private String permission;
    private String dataSourceType;
    private String indexingTechnique;
    private int appCount;
    private int documentCount;
    private int wordCount;
    private String createdBy;
    private long createdAt;
    private String updatedBy;
    private long updatedAt;
    private String embeddingModel;
    private String embeddingModelProvider;
    private Boolean embeddingAvailable;
    private RetrievalModelDict retrievalModelDict;
    private List<String> tags;
    private ExternalKnowledgeInfo externalKnowledgeInfo;
    private ExternalRetrievalModel externalRetrievalModel;

    @Data
    public static class RetrievalModelDict {
        private String searchMethod;
        private boolean rerankingEnable;
        private String rerankingMode;
        private RerankingModel rerankingModel;
        private List<Double> weights;
        private int topK;
        private boolean scoreThresholdEnabled;
        private Double scoreThreshold;

        @Data
        public static class RerankingModel {
            private String rerankingProviderName;
            private String rerankingModelName;
        }
    }

    @Data
    public static class ExternalKnowledgeInfo {
        private String externalKnowledgeId;
        private String externalKnowledgeApiId;
        private String externalKnowledgeApiName;
        private String externalKnowledgeApiEndpoint;
    }

    @Data
    public static class ExternalRetrievalModel {
        private int topK;
        private double scoreThreshold;
        private Boolean scoreThresholdEnabled;
    }

}
